<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./02.css">
</head>
<body>
    <div id="app">
        <div>
            <button v-on:click="change">切换图片</button>
        </div>
        <img v-bind:src="src" alt="">
    </div>
</body>
<script src="./node_modules/vue/dist/vue.js"></script>
<script>
    let vm = new Vue({
        el : "#app",
        data:{
            src:"./images/1.jpeg",
        },
        methods:{
            change:function(e){
                this.src = this.src === "./images/1.jpeg"?"./images/2.jpeg":"./images/1.jpeg";
            }
        }
    });
</script>
</html>